package com.lingxu.api.ztb.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lingxu.api.ztb.mapper.ZtbParagraphMapper;
import com.lingxu.api.ztb.model.ZtbParagraph;
import com.lingxu.api.ztb.model.vo.CimsProjectSectionInfoVO;

import com.lingxu.api.ztb.service.IZtbParagraphService;
import com.lingxu.api.ztb.model.vo.ZtbParagraphVO;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.baomidou.mybatisplus.core.metadata.IPage;


import lombok.extern.slf4j.Slf4j;
import javax.annotation.Resource;
import java.util.*;

/**
 * 标段表 服务实现类
 *
 * @author admin
 * @since 2025-07-18
 */
@Slf4j
@Service
public class ZtbParagraphServiceImpl extends ServiceImpl<ZtbParagraphMapper, ZtbParagraph>  implements IZtbParagraphService {

    @Resource
    private ZtbParagraphMapper ztbParagraphMapper;

    @Transactional(readOnly = true)
    @Override
    public IPage<ZtbParagraphVO> queryPageList(ZtbParagraphVO query) {
        Page<ZtbParagraphVO> page = new Page<ZtbParagraphVO>(query.getPageNo(), query.getPageSize());
        return ztbParagraphMapper.pageList(page,query);
    }


    @Transactional(readOnly = true)
    @Override
    public List<ZtbParagraphVO> list(ZtbParagraphVO query) {
        return ztbParagraphMapper.selectZtbParagraphList(query);
    }

    @Override
    public ZtbParagraphVO getZtbParagraph(ZtbParagraphVO query) {
        return ztbParagraphMapper.getZtbParagraph(query);
    }

    @Transactional(rollbackFor = Exception.class)
    @Override
    public void delete(Set<String> ids) {
        if (CollectionUtils.isNotEmpty(ids)) {
            ztbParagraphMapper.deleteBatchIds(ids);
        }
    }

    @Override
    public List<String> getObjectType() {
        return ztbParagraphMapper.getObjectType();
    }

    @Override
    public IPage<CimsProjectSectionInfoVO> getZtbParagraphShow(ZtbParagraphVO query) {
        Page<CimsProjectSectionInfoVO> page = new Page<CimsProjectSectionInfoVO>(query.getPageNo(), query.getPageSize());
        return ztbParagraphMapper.getZtbParagraphShow(page,query);
    }


}
